package com.brayan.webapp.service.auxilliary;

import javax.faces.bean.ManagedBean;

import com.jcabi.manifests.Manifests;

/**
 * This ManifestReader offers MANIFEST.MF attributes. Add attributes using the
 * maven war plugin in your POM file.
 * 
 * @author Brayan
 * 
 */
@ManagedBean
public class ManifestReader {
	private final static String VERSION_TAG = "App-Version";

	/**
	 * Get the POM Version from the Manifest.
	 * 
	 * @return
	 */
	public String getAppVersion() {
		try{
			return "Version " + Manifests.read(VERSION_TAG);
		}catch(IllegalArgumentException ex){
			return "Illegal Version";
		}
	}

}
